<template>
	<view class="car_card"  @click="clickUseCarCard">
		<view class="title">
			<view class="">
				申请时间
			</view>
			<view class="title_time">
				{{myInfo.apply_create_time}}
			</view>
			<view class="type">
				{{myInfo.apply_state_des}}
			</view>
		</view>
		<view class="">
			<view class="details">
				<view class="tag side">目的地</view>
				<view>{{myInfo.apply_destination}}</view>
			</view>
			<view class="details">
				<view class="tag">用车时间</view>
				<view class="time">{{myInfo.apply_start_time | timeFormat('MM-DD HH:mm')}} 至 {{myInfo.apply_end_time | timeFormat('MM-DD HH:mm')}}</view>
			</view>

		</view>
		<image class="state" v-if="myInfo.apply_state === '待审批'" src="@/static/images/meal/stay.svg" mode=""></image>
		<image class="state" v-else-if="myInfo.apply_state === '已通过'" src="@/static/images/meal/yes.svg" mode=""></image>
		<image class="state" v-else-if="myInfo.apply_state === '已拒绝'" src="@/static/images/meal/no.svg" mode=""></image>
		<image class="state" v-else-if="myInfo.apply_state === '审批中'" src="@/static/images/meal/underway.png" mode=""></image>
		<image class="state" v-else-if="myInfo.apply_state === '已撤销'" src="@/static/images/car/cancel.png" mode=""></image>
	</view>
</template>

<script>
	export default {
		name: "CarCard",
		props: {
			myInfo: Object,
		},
		methods:{
			clickUseCarCard(){
				this.$emit('clickUseCarCard')
			}
		}
	}
</script>

<style lang="scss" scoped>
	
	.car_card {
		position: relative;
		background-color: #FFFFFF;
		// height: 110px;
		box-sizing: border-box;
		padding: 10rpx 30rpx 10rpx 30rpx;
		margin-top: 5px;
		.title{
			display: flex;
			font-size: 24rpx;
			padding: 20rpx 0;
			align-items: center;
			margin-bottom: 20rpx;
			color: #999999;
			border-bottom: 2rpx solid #E6E6E8;
			.title_time{
				flex: 1;
				font-size: 28rpx;
				color: #394954;
				margin-left: 30rpx;
			}
				
			.type{
				color: #EEB725;
			}
		}
	
		.details {
			display: flex;
			font-size: 24rpx;
			padding-left: 20rpx;
			color: #394954;
			margin-bottom: 12px;
	
			.tag {
				// width: 100rpx;
				margin-right: 30rpx;
				color: #999999;
			}
			.side{
				margin-right: 60rpx !important;
			}
		}
	
		.state {
			position: absolute;
			top: 60rpx;
			right: 24rpx;
			width: 100rpx;
			height: 100rpx;
		}
	}
</style>
